
cd "Output"

sed -e '6a\
\\begin{adjustwidth}{-2cm}{}' Balance_Table.tex > Balance_Table_Clean.tex

rm -f Balance_Table.tex
mv Balance_Table_Clean.tex Balance_Table.tex

sed -e '50a\
\\end{adjustwidth}' Balance_Table.tex > Balance_Table_Clean.tex

rm -f Balance_Table.tex
mv Balance_Table_Clean.tex Balance_Table.tex



replace_file ()
{
  rm -f $1
  mv "$2" "$1"
}

clean_3part_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '18d' $1 > $2

replace_file $1 $2

sed -e '19a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '20a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '21a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '22a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '23a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '24a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}


clean_3part_GS_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '29d' $1 > $2

replace_file $1 $2

sed -e '30a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '31a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '32a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '33a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '34a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '35a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}


clean_3part_inter_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '25d' $1 > $2

replace_file $1 $2

sed -e '26a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '27a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '28a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '29a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '30a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '31a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}


clean_3part_7PIDinter_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '36d' $1 > $2

replace_file $1 $2

sed -e '37a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '38a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '39a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '40a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '41a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '42a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}


clean_3part_demoginter_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '30d' $1 > $2

replace_file $1 $2

sed -e '31a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '32a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '33a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '34a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '35a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '36a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}


clean_3part_exLinter_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '27d' $1 > $2

replace_file $1 $2

sed -e '28a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '29a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '30a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '31a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '32a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '33a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}



clean_3part_KSPart_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '37d' $1 > $2

replace_file $1 $2

sed -e '38a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '39a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '40a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '41a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '42a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '43a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}

clean_3part_KSApp_tab ()
{

sed -e '1a\
\\begin{threeparttable}' $1 > $2

replace_file $1 $2

sed '39d' $1 > $2

replace_file $1 $2

sed -e '40a\
\\begin{tablenotes}'  $1 > $2

replace_file $1 $2

sed -e '41a\
\\small'  $1 > $2

replace_file $1 $2

sed -e '42a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '43a\
\\item'  $1 > $2

replace_file $1 $2

sed -e '44a\
\\end{tablenotes}' $1 > $2

replace_file $1 $2

sed -e '45a\
\\end{threeparttable}' $1 > $2

replace_file $1 $2


}

clean_3part_GS_tab Gallup_Suffolk_Regs.tex Gallup_Suffolk_Regs_Clean.tex

sed '33s/$/ The table reports OLS regressions examining the relationship between aggregate partisanship and partisanship-approval question ordering and presidential approval from Gallup and Suffolk University-USA Today polls. The dependent variable is the percentage of respondents who identify with the Republican Party. In the first column the independent variables are an indicator for whether the survey asked partisanship before approval (i.e. Gallup polls) and time period fixed effects. The second column adds presidential approval measured from the Gallup poll and its interaction with asking partisanship before approval. The third column is identical to the specification reported in the second column except presidential approval is measured in the Suffolk polls using the Suffolk level of presidential approval. Columns 4-6 report the analogous specifications to columns 1-3 with the inclusion of time period pair fixed effects. The Gallup polls that are not matched with a Suffolk poll are excluded from these specifications. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Gallup_Suffolk_Regs.tex > Gallup_Suffolk_Regs_Clean.tex

replace_file  Gallup_Suffolk_Regs.tex Gallup_Suffolk_Regs_Clean.tex


clean_3part_KSPart_tab KS_Partisanship.tex KS_Partisanship_Clean.tex

sed '41s/$/ The table reports OLS regressions of respondent self-reported partisanship on the Kriner and Schickler (2014) three informational treatments and individual-level covariates. The dependent variable is an indicator for whether the respondent self-reported as independent in the first column, a Republican in the second column, and a Democrat in the third column. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' KS_Partisanship.tex > KS_Partisanship_Clean.tex

replace_file  KS_Partisanship.tex KS_Partisanship_Clean.tex


clean_3part_KSApp_tab KS_PostTreatment.tex KS_PostTreatment_Clean.tex

sed '43s/$/ The table reports the ordered logit regression of respondent presidential approval on the Kriner and Schickler (2014) three informational treatments and individual-level covariates. The dependent variable is five-point presidential approval. The first column includes respondent self-reported partisanship and the second column omits this potential post-treatment variable from the model. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' KS_PostTreatment.tex > KS_PostTreatment_Clean.tex

replace_file  KS_PostTreatment.tex KS_PostTreatment_Clean.tex


clean_3part_tab NonResponse_Outcome.tex NonResponse_Outcome_Clean.tex

sed '22s/$/ The table reports the OLS regression of non-response to the partisanship or approval items on the question-ordering treatment. In the first-fourth columns, the dependent variable is an indicator for whether the respondent did not respond to the partisanship item. The first column reports an unweighted regression with no individual-level covariates, the second column reports a weighted regression (employing the NORC survey weights) with no individual-level covariates, the third column reports an unweighted regression with individual-level covariates, and the fourth column reports a weighted regression with individual-level covariates. In the fifth-eighth columns, the specifications are identical to the first-fourth columns except the dependent variable is an indicator for not responding to the presidential approval item. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' NonResponse_Outcome.tex > NonResponse_Outcome_Clean.tex

replace_file NonResponse_Outcome.tex NonResponse_Outcome_Clean.tex


clean_3part_tab Rep_Outcome.tex Rep_Outcome_Clean.tex

sed '22s/$/ The table reports the OLS regression of self-reported partisanship on the question-ordering treatment. In the first-fourth columns, the dependent variable is an indicator for whether the respondent self-reported as Republican, including respondents who lean toward the Republicans. The first column reports an unweighted regression with no individual-level covariates, the second column reports a weighted regression (employing the NORC survey weights) with no individual-level covariates, the third column reports an unweighted regression with individual-level covariates, and the fourth column reports a weighted regression with individual-level covariates. In the fifth-eighth columns, the specifications are identical to the first-fourth columns except the dependent variable is defined excluding Republicans. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome.tex > Rep_Outcome_Clean.tex

replace_file Rep_Outcome.tex Rep_Outcome_Clean.tex
 

clean_3part_tab App_Outcome.tex App_Outcome_Clean.tex

sed '22s/$/ The table reports the OLS regression of self-reported presidential approval on the question-ordering treatment. The dependent variable is an indicator for whether the respondent self-reported as Republican. The first column reports an unweighted regression with no individual-level covariates, the second column reports a weighted regression (employing the NORC survey weights) with no individual-level covariates, the third column reports an unweighted regression with individual-level covariates, and the fourth column reports a weighted regression with individual-level covariates. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' App_Outcome.tex > App_Outcome_Clean.tex

replace_file App_Outcome.tex App_Outcome_Clean.tex


clean_3part_tab App_Outcome_Rep.tex App_Outcome_Rep_Clean.tex

sed '22s/$/ The table reports the OLS regression of self-reported presidential approval on the question-ordering treatment, conditional on the respondent self-reporting as a Republican in the survey. The dependent variable is an indicator for whether the respondent self-reported as Republican. The first column reports an unweighted regression with no individual-level covariates, the second column reports a weighted regression (employing the NORC survey weights) with no individual-level covariates, the third column reports an unweighted regression with individual-level covariates, and the fourth column reports a weighted regression with individual-level covariates. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' App_Outcome_Rep.tex > App_Outcome_Rep_Clean.tex

replace_file App_Outcome_Rep.tex App_Outcome_Rep_Clean.tex

clean_3part_inter_tab Rep_Outcome_Het_PID7_Pooled.tex Rep_Outcome_Het_PID7_Pooled_Clean.tex

sed '29s/$/ The table reports the OLS regression of self-reported partisanship on the treatment interacted with respondent baseline partisanship. In the first four columns, the dependent variable is an indicator for whether the respondent self-reported as Republican. In the last four columns the dependent variable is an indicator for whether the respondent self-reported as an independent. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_PID7_Pooled.tex > Rep_Outcome_Het_PID7_Pooled_Clean.tex

replace_file Rep_Outcome_Het_PID7_Pooled.tex Rep_Outcome_Het_PID7_Pooled_Clean.tex

clean_3part_inter_tab Rep_Outcome_Het_PID7_Pooled_Post2018Robust.tex Rep_Outcome_Het_PID7_Pooled_Post2018Robust_Clean.tex

sed '29s/$/ The table reports the OLS regression of self-reported partisanship on the treatment interacted with respondent baseline partisanship. The sample excludes respondents who answered the baseline partisanship question before Jan. 1, 2018. In the first four columns, the dependent variable is an indicator for whether the respondent self-reported as Republican. In the last four columns the dependent variable is an indicator for whether the respondent self-reported as an independent. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_PID7_Pooled_Post2018Robust.tex > Rep_Outcome_Het_PID7_Pooled_Post2018Robust_Clean.tex

replace_file Rep_Outcome_Het_PID7_Pooled_Post2018Robust.tex Rep_Outcome_Het_PID7_Pooled_Post2018Robust_Clean.tex




sed '9d' Rep_Outcome_Het_PID7_Pooled_Logit.tex > Rep_Outcome_Het_PID7_Pooled_Logit_Clean.tex

rm -f Rep_Outcome_Het_PID7_Pooled_Logit.tex
mv Rep_Outcome_Het_PID7_Pooled_Logit_Clean.tex Rep_Outcome_Het_PID7_Pooled_Logit.tex


clean_3part_inter_tab Rep_Outcome_Het_PID7_Pooled_Robust.tex Rep_Outcome_Het_PID7_Pooled_Robust_Clean.tex

sed '29s/$/ The table reports the OLS regression of self-reported partisanship on the treatment interacted with respondent baseline partisanship. In the first four columns, the dependent variable is an indicator for whether the respondent self-reported as Republican. In the last four columns the dependent variable is an indicator for whether the respondent self-reported as an independent. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_PID7_Pooled_Robust.tex > Rep_Outcome_Het_PID7_Pooled_Robust_Clean.tex

replace_file Rep_Outcome_Het_PID7_Pooled_Robust.tex Rep_Outcome_Het_PID7_Pooled_Robust_Clean.tex


clean_3part_inter_tab Rep_Outcome_Het_PID7_Pooled_Logit.tex Rep_Outcome_Het_PID7_Pooled_Logit_Clean.tex

sed '29s/$/ The table reports the logistic regression of self-reported partisanship on the treatment interacted with respondent baseline partisanship. In the first four columns, the dependent variable is an indicator for whether the respondent self-reported as Republican. In the last four columns the dependent variable is an indicator for whether the respondent self-reported as an independent. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_PID7_Pooled_Logit.tex > Rep_Outcome_Het_PID7_Pooled_Logit_Clean.tex

replace_file Rep_Outcome_Het_PID7_Pooled_Logit.tex Rep_Outcome_Het_PID7_Pooled_Logit_Clean.tex



clean_3part_7PIDinter_tab Rep_Outcome_Het_PID7.tex Rep_Outcome_Het_PID7_Clean.tex

sed '40s/$/ The table reports the OLS regression of self-reported partisanship on the treatment interacted with respondent baseline partisanship. In the first four columns, the dependent variable is defined to include respondents who lean toward the Republican Party. In the last four columns, respondents who lean toward the Republican Party are coded as 0. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_PID7.tex > Rep_Outcome_Het_PID7_Clean.tex

replace_file Rep_Outcome_Het_PID7.tex Rep_Outcome_Het_PID7_Clean.tex


clean_3part_demoginter_tab Rep_Outcome_Het_Demog.tex Rep_Outcome_Het_Demog_Clean.tex

sed '34s/$/ The table reports the OLS regression of self-reported partisanship on the treatment interacted with respondent demographics. In the first four columns, the treatment is interacted with an indicator for whether the respondent is non-Black. In the final four rows, the treatment is interacted with an indicator for whether the respondent is under 55 years of age. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_Het_Demog.tex > Rep_Outcome_Het_Demog_Clean.tex

replace_file Rep_Outcome_Het_Demog.tex Rep_Outcome_Het_Demog_Clean.tex


clean_3part_inter_tab Rep_Outcome_ExL.tex Rep_Outcome_ExL_Clean.tex

sed '29s/$/ The table reports the OLS regression of self-reported partisanship on the probability of identifying as a Republican excluding leaners. The treatment is interacted with baseline partisanship, measured excluding leaners. Two-sided p-values calculated from heteroskedasticity robust standard errors are reported in parentheses below the coefficient estimate. /' Rep_Outcome_ExL.tex > Rep_Outcome_ExL_Clean.tex

replace_file Rep_Outcome_ExL.tex Rep_Outcome_ExL_Clean.tex

